<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>为方法设置函数属性</title>
</head>
<body>

</body>
<script type="text/javascript">
    var stuObj = new Object();
    stuObj.id = 1001;
    stuObj.name = "张三";
    stuObj.age = 23;
    stuObj.sayHello = function () {
        alert("hello");
    };
    //console.log(stuObj);
    stuObj.sayHello();
    var userObj = {
        id:1,
        username:"admin",
        password:"123456",
        sayHello:function () {
            alert("hello");
        }
    };
    //userObj.id = 2222;
    //console.log(userObj.id);
    userObj.sayHello();

</script>
</html>